<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="layout/layout.xhtml">
	<ui:define name="content">
		<f:view locale="#{LocalizationController.locale}">
			<h:form styleClass="form-horizontal">
				<div class="span6">
					<h3><h:outputText value="#{msgs.SUT6Create}" /></h3>
					<div class="control-group">
    					<label class="control-label" for="input_name"><h:outputText value="#{msgs.SUT2Name}" /></label>
						<div class="controls">
							<h:inputText id="input_name" value="#{SUTManagerController.sut.name}" />
						</div>
  					</div>
					<div class="control-group">
    					<label class="control-label" for="input_description"><h:outputText value="#{msgs.SUT3Description}" /></label>
						<div class="controls">
							<h:inputText id="input_description" value="#{SUTManagerController.sut.description}" />
						</div>
					</div>
					<div class="control-group">
						<label for="menu_type" class="control-label"><h:outputText value="#{msgs.SUT4Type}" /></label>
						<div class="controls">
							<h:selectOneMenu id="menu_type" value="#{SUTManagerController.selectedType}">
								<f:selectItems value="#{SUTManagerController.typeSelection}" />
								<a4j:support event="onchange" reRender="interactionPanel" action="#{SUTManagerController.onSelectedTypeValue}"/>
							</h:selectOneMenu>
						</div>
					</div>
					<div class="control-group">
						<a4j:outputPanel ajaxRendered="true" id="interactionPanel">
							<h:outputText for="menu_interaction" styleClass="control-label" rendered="#{SUTManagerController.showInteractionMenu}" value="#{msgs.SUT5Interaction}" style="font-size:14px;"/>
							<div class="controls">
								<h:selectOneMenu id="menu_interaction" value="#{SUTManagerController.selectedInteraction}" rendered="#{SUTManagerController.showInteractionMenu}">
									<f:selectItems value="#{SUTManagerController.interactionSelection}" />
									<a4j:support event="onchange" reRender="endpointPanel" action="#{SUTManagerController.onSelectedInteractionValue}"/>
								</h:selectOneMenu>
							</div>
						</a4j:outputPanel>
					</div>
					<div class="control-group">
						<a4j:outputPanel ajaxRendered="true" id="endpointPanel">
							<h:outputText for="input_endpoint" id="value_input_endpoint" rendered="#{SUTManagerController.showEndpointInput}" 
								 styleClass="control-label" value="Endpoint" style="font-size:14px;"/>
							<div class="controls">
								<h:inputText id="input_endpoint" value="#{SUTManagerController.endpoint}" rendered="#{SUTManagerController.showEndpointInput}"/>
							</div>
						</a4j:outputPanel>
					</div>
	  				
	  				<div class="control-group">
						
						<div class="controls">
							<h:commandLink styleClass="btn btn-primary" value="#{msgs.Common1Create}" action="#{SUTManagerController.createNewSUT}" />
	      					<h:commandLink styleClass="btn" value="#{msgs.Common2Cancel}" action="#{SUTManagerController.cancel}" style="margin-left: 10px;"/>
						</div>
					</div>
					
					<div class="control-group">
						
						<div class="controls" style="width: 230px;">
							<a4j:outputPanel styleClass="formErrorMessage" ajaxRendered="true" rendered="#{SUTManagerController.showSutFormMessage}">
		      					<div class="alert alert-error">
									<h:outputText value="#{SUTManagerController.sutFormMessage}" rendered="#{SUTManagerController.showSutFormMessage}" />
								</div>
							</a4j:outputPanel>
						</div>
					</div>
	  			
	  				
  				</div>
  				<div class="span5"> </div>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
</html>